package scoutobahn.xml;
/**
 * Enumeration of OSM data types.
 * @author mark
 *
 */
public enum OsmXmlTypes {
    Node, Way, Relation;
    /**
     * Static method that parses the type string from
     * OsmRelation member elements.
     * @param type Type string.
     * @return The OsmXmlTypes
     */
    public static OsmXmlTypes getTypeFromString(final String type) {
        if (type.equals("node")) {
            return OsmXmlTypes.Node;
        }
        if (type.equals("way")) {
            return OsmXmlTypes.Way;
        }
        if (type.equals("relation")) {
            return OsmXmlTypes.Relation;
        }
        throw new IllegalArgumentException("unkown type " + type);
    }
}
